<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加陪护师信息</title>
</head>

<body>
<button id="addCaregiverBtn">查看陪护师信息</button>
<script>
    document.getElementById('addCaregiverBtn').addEventListener('click', async () => {


        try {
            const caregiverid = 1;
            fetch(`http://localhost:8000/getCaregiverById?caregiverid=${caregiverid}`)
                .then(response => response.json())
                .then(data => {
                    if (response.ok) {
                        console.log('查询到的陪护师信息:', data);
                    } else {
                        console.error(data.error);
                    }
                })
                .catch(error => console.error('请求出错:', error));
        } catch (error) {
            console.error('请求出错:', error);
        }
    });
</script>
</body>

</html>